//
//  StatzSource.h
//  Statz
//
//  Created by Dave MacLachlan on 07/07/23.
//
// Copyright 2007 Google Inc.
// 
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License.  You may obtain a copy
// of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
// License for the specific language governing permissions and limitations under
// the License.
//

#import <Cocoa/Cocoa.h>
#import "StatzProtocols.h"

@class Status;
@class StatzTextAttachment;

extern NSString *const kStatzStatusSourceStatusesKey;
extern NSString *const kStatzStatusSourceCurrentKey;
extern NSString *const kStatzStatusSourceEnabledKey;

@interface StatzSource : NSObject<NSCoding> {
  NSMutableArray *statuses_;
  unsigned int currentStatus_;
  StatzTextAttachment *attachment_;
}
- (id)initWithName:(NSString*)name;
- (NSString*)name;
- (void)setName:(NSString*)name;
- (BOOL)isNameEditable;
- (NSAttributedString *)displayNameAndStatus;
- (NSImage*)image;
- (NSAttributedString*)nameToken;
- (Status*)currentStatus;
- (void)setCurrentStatus:(Status*)status;
- (unsigned int)currentStatusIndex;
- (void)setCurrentStatusIndex:(unsigned int)value;
- (NSArray*)statuses;
- (void)addStatus:(Status*)status;
- (void)removeStatus:(Status*)status;
- (BOOL)isValid;
- (void)addSourceDependenciesTo:(NSMutableArray*)array;
- (BOOL)isEnabled;
- (id)plugin;
- (NSMenu*)stateMenu;
- (StatzState)state;
- (void)setState:(StatzState)state;
- (BOOL)editableStatuses;
+ (StatzState)stateFromScriptState:(OSType)scriptState;
+ (OSType)scriptStateFromState:(StatzState)state;
@end
